package py.com.alfa.escriba.web.rest.impl;

import java.util.List;

import org.springframework.context.ApplicationContext;

import py.com.alfa.escriba.config.EscribaApplicationContextProvider;
import py.com.alfa.escriba.exception.ServiceException;
import py.com.alfa.escriba.persistence.dto.admin.PaisDTO;
import py.com.alfa.escriba.web.rest.EscribaService;
import py.com.alfa.escriba.web.rest.secure.PaisSecureRESTService;
import py.com.alfa.escriba.web.services.PaisService;

public class PaisSecureRESTServiceImpl implements PaisSecureRESTService{

	private ApplicationContext ctx;
	private PaisService paisService;
	
	public PaisSecureRESTServiceImpl() {
		this.ctx = EscribaApplicationContextProvider.getContext();
		this.paisService = (PaisService)this.ctx.getBean(EscribaService.PAIS_SERVICE);	
	}

	@Override
	public List<PaisDTO> listPaises() throws ServiceException {		
		return paisService.listPaises();
	}

	@Override
	public PaisDTO paisById(Long id) throws ServiceException {		
		return paisService.paisById(id);
	}

	@Override
	public PaisDTO paisBycodigo(String codigo) throws ServiceException {		
		return paisService.paisBycodigo(codigo);
	}
}
